package com.reason.gateway.handle;

import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * 统一异常处理类
 * @author  yulongjun
 * @date 2020/7/1 6:23 下午
 */
@ControllerAdvice //声明该类是一个异常类
public class AllException {

    @ExceptionHandler(value = Exception.class)//对那些异常处理
    @ResponseBody
    public String error(Exception e){
        e.printStackTrace();//打印异常
        return "客观您好！服务器正忙者呢。。。。您稍等";

    }

}
